<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./template/template.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html">

    <ui:define name="content">
        <p:panel header="User update" id="userupdate">
            <h:form id="editForm">
                <table>
                    <tr>
                        <td>
                            <h:outputText value="Username:"/>
                        </td>
                        <td>
                            <h:outputText value="#{mbUser.user.userName}" id="username"/>
                            <p:focus for="username"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h:outputText value="Password:"/>
                        </td>
                        <td>
                            <p:inputText type="password" value="#{mbUser.user.transPassword}" id="password"/>
                            <p:message for="password" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h:outputText value="New password:"/>
                        </td>
                        <td>
                            <p:inputText type="password" value="#{mbUser.user.transPasswordNew1}" id="new1password"/>
                            <p:message for="new1password" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h:outputText value="Repeat new password:"/>
                        </td>
                        <td>
                            <p:inputText type="password" value="#{mbUser.user.transPasswordNew2}" id="new2password"/>
                            <p:message for="new2password" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h:outputText value="Firstname:"/>
                        </td>
                        <td>
                            <p:inputText value="#{mbUser.user.firstName}"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h:outputText value="Last name:"/>
                        </td>
                        <td>
                            <p:inputText value="#{mbUser.user.lastName}"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h:outputText value="JMBG::"/>
                        </td>
                        <td>
                            <p:inputMask value="#{mbUser.user.jmbg}" id="jmbg" mask="9999999999999"/>
                            <p:message for="jmbg"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p:commandButton value="Save" ajax="false" action="#{mbUser.navigationAfterUpdateUser}"/>
                        </td>
                        <td>
                            <p:commandButton value="Cancel" ajax="false" immediate="true"  action="#{mbUser.navigationToHome}"/>
                        </td>
                    </tr>
                </table>
            </h:form>
        </p:panel>
    </ui:define>

</ui:composition>
